#include "Attribute.hpp"

//-------------------------------------
// Class: Attribute
//-------------------------------------

Attribute::Attribute(int cur, int max)
{
    m_cur = cur;
    m_max = m_cur;
    m_bonus = 0;
    m_ticks = 0;
}

//-------------------------------------
// Class: BodyAttributes
//-------------------------------------

// This is a table of body multipliers, see the design wiki.

double BODY_MULT[BodyAttributes::MAX_TYPES][3] = {
    // Brawn        Deft        Grit
    {  1.1,         1.0,        1.0},
    {  1.1,         0.8,        1.1},
    {  1.4,         0.5,        1.1},
    {  1.0,         1.1,        1.0},
    {  0.5,         1.3,        1.2},
    {  1.2,         1.2,        0.6},
    {  1.0,         1.0,        1.1},
    {  1.0,         0.8,        1.3},
    {  1.1,         0.9,        1.1},
    {  0.9,         1.0,        0.9},
    {  0.8,         1.0,        1.0},
    {  0.8,         0.8,        0.8}
};

BodyAttributes::BodyAttributes(int type, int start) :
    m_brawn(start), m_deft(start), m_grit(start)
{
    m_type = type;
    m_brawnMult = BODY_MULT[type][0];
    m_deftMult = BODY_MULT[type][1];
    m_gritMult = BODY_MULT[type][2];
}

//-------------------------------------
// Class: MindAttributes
//-------------------------------------

// This is a table of mind multipliers, see the design wiki.

double MIND_MULT[MindAttributes::MAX_TYPES][3] = {
    // Power        Wit         Will
    {  1.0,         1.0,        1.1},
    {  0.8,         0.9,        1.3},
    {  0.7,         1.2,        1.2},
    {  1.0,         1.1,        1.0},
    {  1.1,         1.2,        0.8},
    {  0.9,         1.3,        0.8},
    {  1.1,         1.0,        1.0},
    {  1.6,         0.7,        0.7},
    {  1.3,         0.9,        0.8},
    {  1.0,         0.8,        0.9},
    {  1.0,         0.9,        0.7},
    {  0.6,         1.0,        1.0}
};

MindAttributes::MindAttributes(int type, int start) :
    m_power(start), m_wit(start), m_will(start)
{
    m_type = type;
    m_powerMult = MIND_MULT[type][0];
    m_witMult = MIND_MULT[type][1];
    m_willMult = MIND_MULT[type][2];
}
